﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using KPIS.GERP.GHRMS.DALFactory;
using KPIS.GERP.GHRMS.IDAL;
using KPIS.GERP.GHRMS.IBLL;
using KPIS.GERP.GHRMS.MODEL;

namespace KPIS.GERP.GHRMS.BLL
{
    public class MasAreaBLL : IMasAreaBLL
    {
        public static readonly IMasAreaDAL dal = DataAccess.CreateMasterAreas();
        private MasAreaInfo Info = new MasAreaInfo();

        public IList<MasAreaInfo> ListMasAreas(Nullable<int> Sequence)
        {
            return dal.ListMasAreas(Sequence);
        }
        public void Insert(string Name, string NameEng, string Remarks, int CreatedBy)
        {
            try
            {
                dal.Insert(new MasAreaInfo(0, Name, NameEng, Remarks, CreatedBy, 0));
            }
            catch
            {
                throw new Exception("");
            }
        }
        public void Update(int Sequence, string Name, string NameEng, string Remarks, int UpdatedBy)
        {
            try
            {
                dal.Update(new MasAreaInfo(Sequence, Name, NameEng, Remarks, 0, UpdatedBy));
            }
            catch
            {
                throw new Exception("");
            }
        }
        public void Delete(int Sequence, int UpdatedBy)
        {
            try
            {
                dal.Delete(new MasAreaInfo(Sequence, "", "", "", 0, UpdatedBy));
            }
            catch
            {
                throw new Exception("");
            }
        }
    }
}
